﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace DecisionFramework.ServiceProtection
{
    /// <summary>
    /// Specifies the interface for a way to determine if 
    /// an object is authorized for a given security token.
    /// </summary>
    /// <remarks>
    /// Represents a strategy for authorization.
    /// </remarks>
    public interface IAuthorizationAction
    {
        /// <summary>
        /// Whether the principal associated with the given security token 
        /// is authorized for the given object.
        /// </summary>
        /// <param name="securityToken"></param>
        /// <param name="obj">The object to check if authorized; can be null.</param>
        /// <returns>Whether the principal associated with the given security token 
        /// is authorized for the given object.
        /// </returns>
        bool IsAuthorizedFor(string securityToken, object toObject);
    }
}
